<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:57:"E:\WWW\waimai/app/wechat/order\view\order\send_order.html";i:1505789258;s:54:"E:\WWW\waimai/app/wechat/order\view\template\base.html";i:1502523229;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <title>外卖</title>
    <link rel="stylesheet" href="__STATIC__/css/mui.min.css">
    <link rel="stylesheet" href="__STATIC__/css/ks.css">
    
    <script>
        var require_path = "__STATIC__/app";
    </script>
    <script src="__STATIC__/app/plugin/wechat/weixin.js"></script>
    <script src="__STATIC__/app/require.js"></script>
    <script src="__STATIC__/app/require.config.js"></script>
    <script src="__STATIC__/app/plugin/jquery-3.2.1.min.js"></script>
    <script src="__STATIC__/app/plugin/mui/mui.min.js"></script>
    
</head>
<body>




<header class="header">
    <div>
        <a class="back" href="<?php echo url('cart/Cart/index'); ?>"><i
                class="iconfont icon-zuoyoujiantou-copy-copy-copy"></i></a>
        确认订单
    </div>
</header>
<div class="pages" id="order_page">
    <div class="list-form other not-t">
        <ul>
            <li>
                <a id="set_address" class="list-form-link">
                    <div class="checkbox-view">
                        <input type="radio" name="address" checked value="<?php echo $user_address['id']; ?>" @change="default_check()">
                    </div>
                    <div>
                        <div class="font14">
                            <div class="pull-left">收货人：</div>
                            <div class="overflow-hidden">
                                <div><?php echo $user_address['name']; ?> <span class="pull-right"><?php echo $user_address['mobile']; ?></span>&nbsp;</div>
                            </div>
                        </div>
                       <div class="font12">
                           <div class="pull-left">收货地址：</div>
                           <div class="overflow-hidden">
                               <div><?php echo $user_address['province']; ?><?php echo $user_address['city']; ?><?php echo $user_address['district']; ?><?php echo $user_address['address']; ?></div>
                           </div>
                       </div>
                    </div>
                </a>
            </li>
            <li>
                <div class="checkbox-view">
                    <input type="radio" name="address" value="0" @change="other_check()" >
                    <input type="hidden" name="o_province" id="o_province" value="">
                    <input type="hidden" name="o_city" id="o_city" value="">
                    <input type="hidden" name="o_district" id="o_district" value="">
                    <input type="hidden" name="o_lng" id="o_lng" value="">
                    <input type="hidden" name="o_lat" id="o_lat" value="">
                    <input type="hidden" name="o_zoom" id="o_zoom" value="12">
                    <input type="hidden" name="o_name" id="o_name" value="">
                </div>
                <div class="font12">其它收货地址</div>
                <div id="other_address" style="display: none;">
                    <div class="add-btn-right mt-unify">
                        <div class="l">
                            <div><input type="text" id="o_address" name="o_address" placeholder="我的收货地址"></div>
                        </div>
                        <!--<div class="r">-->
                        <!--<i class="iconfont icon-ditu"></i>-->
                        <!--</div>-->
                    </div>
                    <div class="add-btn-right">
                        <div class="l">

                            <div><input type="tel" name="o_mobile" id="o_mobile" placeholder="联系电话"></div>
                        </div>
                    </div>
                    <div class="add-btn-right">
                        <div class="l">
                            <textarea name="remark" id="remark" placeholder="我要留言"></textarea>
                        </div>
                    </div>
                </div>

            </li>
            <!--<li>-->
                <!--<div class="checkbox-view"></div>-->
                <!--<div class="add-btn-right">-->
                    <!--<div class="l">-->
                        <!--<div>-->
                            <!--<textarea name="remark" id="remark" placeholder="我要留言"></textarea>-->
                        <!--</div>-->
                    <!--</div>-->
                    <!--<div class="r">-->
                    <!--<i class="iconfont icon-yuyin"></i>-->
                    <!--</div>-->
                <!--</div>-->
            <!--</li>-->
        </ul>


        <?php if(is_array($list) || $list instanceof \think\Collection || $list instanceof \think\Paginator): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
        <div style="border-top: 5px solid #ececec ">
            <div class="shop-list title">
                <ul>
                    <li>
                        <div class="img"><img src="<?php echo $vo['logo']; ?>" height="441" width="500"/></div>
                        <div class="text"><?php echo $vo['name']; ?></div>
                    </li>
                </ul>
            </div>
            <div>
                <ul>
                    <li>
                        <?php if(is_array($vo['items']) || $vo['items'] instanceof \think\Collection || $vo['items'] instanceof \think\Paginator): $i = 0; $__LIST__ = $vo['items'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$item): $mod = ($i % 2 );++$i;?>
                        <p class="order-list">
                            <span class="font12"><?php echo $item['name']; ?></span>
                            <span>x<?php echo $item['num']; ?></span>
                            <span>￥<?php echo $item['price']; ?></span>
                        </p>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </li>
                    <li class="color-primary">
                        <span class="pull-right">小计：￥<?php echo $vo['total_price']; ?></span>
                    </li>
                </ul>
            </div>
        </div>
        <?php endforeach; endif; else: echo "" ;endif; ?>


    </div>
    <div class="foot-btn">
        <div>
            总价：<?php echo $total_price; ?>元
            <a @tap.stop="add_order()" class="btn">提交订单</a>
        </div>
    </div>
</div>



</body>
<script>
    if(document.querySelector('.goback')!=null){
        document.querySelector('.goback').addEventListener('tap', function () {
            history.back();
        })
    }
    host="<?php echo \think\Request::instance()->host(); ?>";
    se_url="<?php echo \think\Request::instance()->baseUrl(); ?>";

    if(se_url=="/wechat.php"){
        current_url= 'http://'+window.location.host+se_url+'/index/index/index'+'?parent_id='+"<?php echo $account['id']; ?>";
    }else{
        current_url='http://'+window.location.host+"<?php echo \think\Request::instance()->baseUrl(); ?>"+'?parent_id='+"<?php echo $account['id']; ?>";
    }
    console.log(current_url)

    appId='<?php echo $js_sdk['appid']; ?>' ; // 必填，公众号的唯一标识
    timestamp= '<?php echo $js_sdk['time']; ?>';// 必填，生成签名的时间戳
    nonceStr= '<?php echo $js_sdk['nonceStr']; ?>'; // 必填，生成签名的随机串
    signature= '<?php echo $js_sdk['signature']; ?>';// 必填，签名，见附录1
    jsApiList= [ 'scanQRCode','onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ','chooseImage','uploadImage', 'checkJsApi', 'openLocation', 'getLocation']; // 必填，需要使用的JS接口列表，所有JS接口列表见附录2

    wx.config({
        debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
        appId:appId , // 必填，公众号的唯一标识
        timestamp: timestamp, // 必填，生成签名的时间戳
        nonceStr: nonceStr, // 必填，生成签名的随机串
        signature: signature,// 必填，签名，见附录1
        jsApiList: jsApiList // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
    });

    wx.checkJsApi({
        jsApiList: [ 'scanQRCode','onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ','chooseImage','uploadImage', 'checkJsApi', 'openLocation', 'getLocation'],
        success: function (res) {
            // alert(JSON.stringify(res));
            // alert(JSON.stringify(res.checkResult.getLocation));
            if (res.checkResult.getLocation == false) {
                alert('你的微信版本太低，不支持微信JS接口，请升级到最新的微信版本！');
                return;
            }
        }
    });
    wx.ready(function(){
        var shareData = {
            title: '外卖',            //朋友圈文案（朋友圈没有标题）
            desc: '钦州外卖就系快',
            link:current_url,
            imgUrl:'http://wm.qzzm.com/public/wechat/static/image/default.png',
            success: function () {
                mui.toast('分享成功')
            },
            cancel: function () {
                mui.toast('您已取消分享')
            }
        };
        wx.onMenuShareTimeline(shareData);
        wx.onMenuShareAppMessage(shareData);
        wx.onMenuShareQQ(shareData);
        wx.onMenuShareWeibo(shareData);
        wx.onMenuShareQZone(shareData);
    });
</script>

<script>
    var add_order_url = "<?php echo url('order/Order/add_order'); ?>";
    var pay_url = "<?php echo url('order/Order/pay'); ?>";
    var address_url = "<?php echo url('user/address/index'); ?>";
    var cart_ids = "<?php echo $cart_ids; ?>";
    var c_url = "<?php echo $c_url; ?>";
    var back_url = "<?php echo $back_url; ?>";
    require(['order/send_order']);
</script>

</html>